//继承
class Person{
    constructor(name,age) {
        this.name = name
        this.age = age
    }

    say(){
        console.log(`大家好：${this.name},${this.age}`)
    }
}

let p1 = new Person("xm",45)
p1.say()

class XiaoDi extends Person{
//    需要先构造父类
    constructor(name,age) {
        super(name,age)
        this.name = name
        this.age = age
    }
    say(){
        console.log('人狠话不多！')
    }
}
let x1 = new XiaoDi('小冬瓜',26)
x1.say()